package serverClientLib;

import java.io.IOException;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Client extends Thread {

    private Socket sock;
    private String nick;
    private int port;
    
    public Client (String nick, int port) {
        this.nick = nick;
        this.port = port;
    }
    
    public void connect() {
        try {
            sock = new Socket (nick, port);
        } catch (IOException ex) {
            System.err.println ("[Client] Error 0x00: Couldn't connect to socket " + port + ".");
        }
        
        System.out.println ("[" + sock.getInetAddress().toString() + "] Now communicating to port [" + port + "] from Server.");
    }
    
    public void run() {
//        while (true) {
            connect();
//        }
    }
    
    public static void main (String[] args) {
           Thread t = new Client("localhost", 8000);
           t.start();
    }
    
    
    
    
}

/* 

o WebClient está aqui como exemplo e inspiração para a programação do cliente normal

*/